package top.lidee.common.service.twice.third.wechat;

import org.apache.http.client.methods.HttpPost;
import top.lidee.framework.result.ResponseResult;
import top.lidee.repository.model.MtStore;
import top.lidee.repository.model.twice.pojo.management.MtStoreWechatInputPieceLogEntity;

import java.security.cert.X509Certificate;
import java.util.Map;

/**
 * @author 张一恒
 * @version 1.0
 * @description: 进件通用
 * @date 2024/10/19 09:50
 */
public interface WechatPayJJCommonService {

    /**
     * @param managerId
     * @param store
     * @return top.lidee.framework.result.ResponseResult
     * @description 基本校验
     * @author zhangyiheng
     * @date 2024/10/19 09:31
     */
    public Map<String,Object> checkInfo(Integer managerId,
                                        MtStore store);

    /**
     * @param storeId
     * @param to
     * @param httpPost
     * @param store
     * @return top.lidee.framework.result.ResponseResult
     * @description 处理结果
     * @author zhangyiheng
     * @date 2024/10/19 09:45
     */
    public <T> ResponseResult doWXRES(Integer storeId, T to, HttpPost httpPost, MtStore store, String tmp, MtStoreWechatInputPieceLogEntity pieceLog);

    /**
     * @param filePath
     * @return java.security.cert.X509Certificate
     * @description 获取证书
     * @author zhangyiheng
     * @date 2024/10/19 09:39
     */
    public X509Certificate getCertificate(String filePath);


    /**
     * @param message
     * @return java.lang.String
     * @description 信息加密
     * 参考：https://pay.weixin.qq.com/docs/partner/development/interface-rules/sensitive-data-encryption.html
     * @author zhangyiheng
     * @date 2024/10/5 11:50
     */
    public String rsaEncryptOAEP(String message, X509Certificate certificate);

    /**
     * @param imageUrl
     * @return java.lang.String
     * @description 图片上传API
     * @author zhangyiheng
     * @date 2024/10/15 09:00
     */
    public String wxGetImageMediaId(String imageUrl);

    /**
     * @param url
     * @return org.apache.http.client.methods.CloseableHttpResponse
     * @description 发送请求get
     * @author zhangyiheng
     * @date 2024/10/8 16:56
     */
    public Map<String, Object> pushRequestOfGetApply(String url, String tmp);


    /**
     * @description 获取微信证书序列号
     * 【证书序列号】 平台证书的主键，唯一定义此资源的标识
     * @return java.lang.String
     * @author zhangyiheng 
     * @date 2024/10/24 12:30
     */
    public String getSerialNo();
}
